//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
   frilist: null,
   
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
    // console.log('onLoad')
    var that = this
    // 加载时请求数据
    wx.request({
      url: 'http://apis.juhe.cn/cook/category?parentid=&dtype=&key=ce8ec60d7729763b4688fac09120ef0a', 
      data: {
        x: '',
        y: ''
      },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.setData({
          frilist: res.data.result
        })
      }
    })
  }
})
